package com.ken.app.beans;

import com.ken.app.enums.ResultCode;

import java.util.HashMap;

/**
 * Author: Liuk
 * Mail: leo_work@aliyun.com
 * Date: 2017/8/15 0015
 * Desc: 接口返回对象
 */
public class ResultObj extends HashMap<String, Object> {

    private static final String CODE = "code";
    private static final String MSG = "msg";
    private static final String DATA = "data";

    public ResultObj(){

    }

    public ResultObj(ResultCode resultCode, String msg, Object data) {
        this.put(CODE, resultCode.getCode());
        this.put(MSG, msg);
        this.put(DATA, data);
    }

    public ResultObj(ResultCode resultCode, String msg) {
        this.put(CODE, resultCode.getCode());
        this.put(MSG, msg);
    }
}
